<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/views/global/taglibs.jsp" %>
<!DOCTYPE>
<html>
  <head>
    <base href="<%=basePath %>">
    <title>${pageDetail.title }</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<%@include file="/views/global/include.jsp" %>
	<c:forEach var="item" items="${cssUrlList }">
		<link rel="stylesheet" type="text/css" href="${item }" />
	</c:forEach>
  </head>
  
  <body>
 	<div class="row">
 		<script type="text/plain" id="detailContent">${pageDetail.content }</script>
 	</div>
 	<div class="clearfix"></div>
 	<form id="submitForm" method="post">
 		<input type="hidden" name="id" value="${pageDetail.id }"/>
 		<input type="hidden" name="linkType" value="${linkType }"/>
 		<input type="hidden" name="pageKey" value="${pagePanel.pageKey }"/>
 		<input type="hidden" name="title" value=""/>
 		<div class="row">
 			<label class="form-label">其他样式地址:</label>
 			<textarea rows="2" cols="60" name="cssUrls" class="form-control">${pageDetail.cssUrls }</textarea>
 		</div>
 		<div class="row">
 			<input type="button" id="btnSave" class="btn btn-default" value="保 存"/>
 		</div>
 	</form>
 	<%@include file="/views/global/AdminScripts.jsp" %>
 	<script type="text/javascript" src="static/javascript/global/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="static/javascript/global/ueditor/ueditor.all.js"></script>
  </body>
<script type="text/javascript">
var detailContentEditor;
$(document).ready(function(){
	detailContentEditor = UE.getEditor("detailContent", {
		initialFrameWidth: 980, initialFrameHeight: 300
	});
	
	$("INPUT[name='title']").val(art.dialog.data("title"));
	$("#btnSave").click(function(){
		$("#submitForm").goAjax({semantic: false, checkLogin: true,
			url: "admin/pageEdit/saveDetail",
			data:{content: detailContentEditor.getContent()},
			success: function(jsonData) {
				if(true == jsonData.success){
	   				art.dialog.data("result", "true");
	   				art.dialog.data("detailId", jsonData.detailId);
	   				art.dialog.close();
	   			} else {
	   				$.error(jsonData.message);
	   			}
			}
		});
	});
});
</script>
</html>
